<nav class="navbar navbar-fixed-top" role="navigation" style="margin-bottom:0;background:#fff;border-bottom:1px solid #eaeaea;">
    <!-- 顶栏 -->
    <div class="navbar-header">
        <a class="navbar-brand default" style="font-size:20px;font-weight:bold;"><?php echo ADMIN_SYS_NAME; ?></a>
    </div>
    <!-- /.navbar-header -->
    <ul class="nav navbar-top-links navbar-right" style="margin-right:10px;">
        <li id="side-menu-icon"><a class="default bg-primary"><i class="fa fa-list-alt fa-fw"></i></a></li>
        <li class="dropdown">
            <a href="#" data-toggle="dropdown" class="dropdown-toggle"><i class="fa fa-user fa-fw"></i>  <i class="fa fa-caret-down"></i></a>
            <ul class="dropdown-menu dropdown-user">
                <li><a href="javascript:;"><i class="fa fa-user fa-fw"></i><?php echo $_SESSION['uname']; ?></a></li>
                <li><a href="javascript:openDialog(url('/user/userinfopop'));"><i class="fa fa-tag fa-fw"></i>个人信息</a></li>
                <li><a href="javascript:openDialog(url('/user/passwdpop'));"><i class="fa fa-key fa-fw"></i>更改密码</a></li>
                <li class="divider"></li>
                <li><a id="logout" href="javascript:confirm('你确认退出登录吗？')?jumpUrl(url('/login/logout')):void(0);"><i class="fa fa-sign-out fa-fw"></i>登出</a></li>
            </ul>
        </li>
    </ul>
    <!-- 侧边栏 -->
    <div class="navbar-default navbar-static-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                <li><a class="default bg-primary"><i class="fa fa-list-alt fa-fw"></i>菜单</a></li>
                <?php $m=0; foreach((array)$menu as $topname => $nav) { $m++; ?>
                    <li at="<?php echo $m; ?>" class="menu_side menu<?php echo $m; ?>">
                        <a href="#"><i class="fa fa-credit-card fa-fw"></i><?php echo $topname; ?><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <?php foreach((array)$nav as $info) { ?>
                                <li><a href="<?php echo $info['link']; ?>"><?php echo $info['name']; ?></a></li>
                            <?php } ?>
                        </ul>
                    </li>
                <?php } ?>
            </ul>
        </div>
    </div>
</nav>
<script>
    // 设置菜单栏滚动条
    var nav_height = $(window).height()-$('.navbar-header').height()-30;
    $('#side-menu').height(nav_height).css('overflowY', 'auto');

    $('.menu_side').click(function() {
        setCookie('menu', $(this).attr('at'), 12, url());
    });

    var menu = $('.menu'+getCookie('menu'));
    if(menu.size()) {
        menu.addClass('active');
    } else {
        $('.menu1').addClass('active');
    }

    function url(url) {
        var url = url ? url : '';
        return '<?php echo APP_ADMIN_PATH; ?>'+url;
    }

    $("#side-menu-icon").click(function() {
        if ($("#side-menu").parent().hasClass("collapse")) {
            $("#side-menu").parent().removeClass("collapse");
        }else {
            $("#side-menu").parent().addClass("collapse");
        }
    });
    

</script>
<div class="modal fade" id="Modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"></div></div></div>